import Vue from 'vue'
import Router from 'vue-router'
const login = () => import('@/page/login')
const forWord = () => import('@/page/forword')
const leader = () => import('@/page/leader')
const agent = () => import('@/page/agent')
const tAgent = () => import('@/page/tAgent')
const cash = () => import('@/page/cash')
const roomCardClass = () => import('@/page/roomCardClass')
const roomSearch = () => import('@/page/roomSearch')
const giveCard = () => import('@/page/giveCard')
const incomeSearch = () => import('@/page/icomeSearch')
const changeWord = () => import('@/page/changeWord')
const about = () => import('@/page/about')
const createCulb = () => import('@/page/createCulb')
const ClubDetailsList = () => import('@/page/ClubDetailsList')
const createAgent = () => import('@/page/createAgent')
const agentDetails = () => import('@/page/agentDetails')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
      // beforeEnter: (to, from, next) => {
      //   localStorage.clear()
      //   next()
      // }
    },
    {
      path: '/forWord',
      name: 'forWord',
      component: forWord
    },
    {
      path: '/leader',
      name: 'leader',
      component: leader
    },
    {
      path: '/agent',
      name: 'agent',
      component: agent
    },
    {
      path: '/tAgent',
      name: 'tAgent',
      component: tAgent
    },
    {
      path: '/cash',
      name: 'cash',
      component: cash
    },
    {
      path: '/roomCardClass/:id',
      name: 'roomCardClass',
      component: roomCardClass
    },
    {
      path: '/roomSearch',
      name: 'roomSearch',
      component: roomSearch
    },
    {
      path: '/giveCard',
      name: 'giveCard',
      component: giveCard
    },
    {
      path: '/incomeSearch/:title',
      name: 'incomeSearch',
      component: incomeSearch
    },
    {
      path: '/changeWord',
      name: 'changeWord',
      component: changeWord
    },
    {
      path: '/about',
      name: 'about',
      component: about
    },
    {
      path: '/createCulb',
      name: 'createCulb',
      component: createCulb
    },
    {
      path: '/createAgent',
      name: 'createAgent',
      component: createAgent
    },
    {
      path: '/ClubDetailsList',
      name: 'ClubDetailsList',
      component: ClubDetailsList
    },
    {
      path: '/agentDetails',
      name: 'agentDetails',
      component: agentDetails
    }
  ]
})
